<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $parts = M('Part')->select();
        $cates = M('Cate')
        ->Join('bbs_user on bbs_cate.uid =bbs_user.uid' )
         ->field('bbs_cate.*,bbs_user.uname as username')
        ->select();
        //var_dump($cates);
        $this->assign('parts', $parts);
        $this->assign('cates', $cates);
        $this->display();
    }
}